<div>
    <h2 id="page-heading">
        <span jhiTranslate="jhipsterApp.testRootBankAccount.home.title">Bank Accounts</span>
        <button id="jh-create-entity" class="btn btn-primary float-right jh-create-entity create-bank-account-my-suffix" [routerLink]="['/bank-account-my-suffix/new']">
            <fa-icon [icon]="'plus'"></fa-icon>
            <span  jhiTranslate="jhipsterApp.testRootBankAccount.home.createLabel">
            Create a new Bank Account
            </span>
        </button>
    </h2>
    <jhi-alert></jhi-alert>
    <br/>
    <div class="alert alert-warning" *ngIf="bankAccounts?.length === 0">
        <span jhiTranslate="jhipsterApp.testRootBankAccount.home.notFound">No bankAccounts found</span>
    </div>
    <div class="table-responsive" *ngIf="bankAccounts?.length > 0">
        <table class="table table-striped" aria-describedby="page-heading">
            <thead>
            <tr>
            <th><span jhiTranslate="global.field.id">ID</span></th>
            <th><span jhiTranslate="jhipsterApp.testRootBankAccount.name">Name</span></th>
            <th><span jhiTranslate="jhipsterApp.testRootBankAccount.bankNumber">Bank Number</span></th>
            <th><span jhiTranslate="jhipsterApp.testRootBankAccount.agencyNumber">Agency Number</span></th>
            <th><span jhiTranslate="jhipsterApp.testRootBankAccount.lastOperationDuration">Last Operation Duration</span></th>
            <th><span jhiTranslate="jhipsterApp.testRootBankAccount.meanOperationDuration">Mean Operation Duration</span></th>
            <th><span jhiTranslate="jhipsterApp.testRootBankAccount.balance">Balance</span></th>
            <th><span jhiTranslate="jhipsterApp.testRootBankAccount.openingDay">Opening Day</span></th>
            <th><span jhiTranslate="jhipsterApp.testRootBankAccount.lastOperationDate">Last Operation Date</span></th>
            <th><span jhiTranslate="jhipsterApp.testRootBankAccount.active">Active</span></th>
            <th><span jhiTranslate="jhipsterApp.testRootBankAccount.accountType">Account Type</span></th>
            <th><span jhiTranslate="jhipsterApp.testRootBankAccount.attachment">Attachment</span></th>
            <th><span jhiTranslate="jhipsterApp.testRootBankAccount.description">Description</span></th>
            <th><span jhiTranslate="jhipsterApp.testRootBankAccount.user">User</span></th>
            <th></th>
            </tr>
            </thead>
            <tbody>
            <tr *ngFor="let bankAccount of bankAccounts ;trackBy: trackId">
                <td><a [routerLink]="['/bank-account-my-suffix', bankAccount.id, 'view' ]">{{bankAccount.id}}</a></td>
                <td>{{bankAccount.name}}</td>
                <td>{{bankAccount.bankNumber}}</td>
                <td>{{bankAccount.agencyNumber}}</td>
                <td>{{bankAccount.lastOperationDuration}}</td>
                <td>{{bankAccount.meanOperationDuration}}</td>
                <td>{{bankAccount.balance}}</td>
                <td>{{bankAccount.openingDay | date:'mediumDate'}}</td>
                <td>{{bankAccount.lastOperationDate | date:'medium'}}</td>
                <td>{{bankAccount.active}}</td>
                <td jhiTranslate="{{'jhipsterApp.BankAccountType.' + bankAccount.accountType}}">{{bankAccount.accountType}}</td>
                <td>
                    <a *ngIf="bankAccount.attachment" (click)="openFile(bankAccount.attachmentContentType, bankAccount.attachment)" jhiTranslate="entity.action.open">open</a>
                    <span *ngIf="bankAccount.attachment">{{bankAccount.attachmentContentType}}, {{byteSize(bankAccount.attachment)}}</span>
                </td>
                <td>{{bankAccount.description}}</td>
                <td>
                    {{bankAccount.userLogin}}
                </td>
                <td class="text-right">
                    <div class="btn-group">
                        <button type="submit"
                                [routerLink]="['/bank-account-my-suffix', bankAccount.id, 'view' ]"
                                class="btn btn-info btn-sm">
                            <fa-icon [icon]="'eye'"></fa-icon>
                            <span class="d-none d-md-inline" jhiTranslate="entity.action.view">View</span>
                        </button>
                        <button type="submit"
                                [routerLink]="['/bank-account-my-suffix', bankAccount.id, 'edit']"
                                class="btn btn-primary btn-sm">
                            <fa-icon [icon]="'pencil-alt'"></fa-icon>
                            <span class="d-none d-md-inline" jhiTranslate="entity.action.edit">Edit</span>
                        </button>
                        <button type="submit"
                                [routerLink]="['/bank-account-my-suffix', { outlets: { popup: bankAccount.id + '/delete'} }]"
                                replaceUrl="true"
                                queryParamsHandling="merge"
                                class="btn btn-danger btn-sm">
                            <fa-icon [icon]="'times'"></fa-icon>
                            <span class="d-none d-md-inline" jhiTranslate="entity.action.delete">Delete</span>
                        </button>
                    </div>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
</div>
